# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1DocumentReference do
  @moduledoc """
  References to the documents.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the document is created.
  *   `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the document is deleted.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - display_name of the referenced document; this name does not need to be consistent to the display_name in the Document proto, depending on the ACL constraint.
  *   `documentIsFolder` (*type:* `boolean()`, *default:* `nil`) - The document type of the document being referenced.
  *   `documentIsLegalHoldFolder` (*type:* `boolean()`, *default:* `nil`) - Document is a folder with legal hold.
  *   `documentIsRetentionFolder` (*type:* `boolean()`, *default:* `nil`) - Document is a folder with retention policy.
  *   `documentName` (*type:* `String.t`, *default:* `nil`) - Required. Name of the referenced document.
  *   `snippet` (*type:* `String.t`, *default:* `nil`) - Stores the subset of the referenced document's content. This is useful to allow user peek the information of the referenced document.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the document is last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :deleteTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :documentIsFolder => boolean() | nil,
          :documentIsLegalHoldFolder => boolean() | nil,
          :documentIsRetentionFolder => boolean() | nil,
          :documentName => String.t() | nil,
          :snippet => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:deleteTime, as: DateTime)
  field(:displayName)
  field(:documentIsFolder)
  field(:documentIsLegalHoldFolder)
  field(:documentIsRetentionFolder)
  field(:documentName)
  field(:snippet)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1DocumentReference do
  def decode(value, options) do
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1DocumentReference.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1DocumentReference do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
